package com.system.controller;

import com.system.pojo.AssessmentByOrg;
import com.system.service.AssessmentByOrgService;
import com.system.util.JSONUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class AssessmentByOrgController {
    @Resource
    private AssessmentByOrgService assessmentByOrgService;

    JSONUtil jsonUtil = new JSONUtil();

    @RequestMapping("selectOrgAss")
    @ResponseBody
    public String selectOrgAss(String id) {
        return assessmentByOrgService.selectOrgAss(id);
    }

    @RequestMapping("saveAssessment")
    @ResponseBody
    public String saveAssessment(@RequestBody List<AssessmentByOrg> list) {
        return jsonUtil.toJson("0", assessmentByOrgService.saveAssessment(list), "保存成功！");
    }

    public AssessmentByOrgService getAssessmentByOrgService() {
        return assessmentByOrgService;
    }

    public void setAssessmentByOrgService(AssessmentByOrgService assessmentByOrgService) {
        this.assessmentByOrgService = assessmentByOrgService;
    }
}
